"use strict"
const path = require("path")
const fs = require("fs")
module.exports = app => {
    const exports = {}

    exports.siteFile = {
        "/favicon.png": fs.readFileSync(path.join(app.baseDir, "app/public/img/favicon.png"))
    }

    exports.siteConfig = {
        title: "昂司工具",
        keywords: "昂司前端,大前端,昂司工具,图片压缩工具",
        description: "专注于内部效率工具的研发"
    }

    exports.vuessr = {
        layout: path.join(app.baseDir, "app/view/layout.tpl"),
        renderOptions: {
            basedir: path.join(app.baseDir, "app/view")
        },
        injectRes: []
    }

    exports.view = {
        defaultViewEngine: "nunjucks",
        mapping: {
            ".tpl": "nunjucks",
        }
    }

    exports.proxy = true

    exports.keys = "KCMs7oqxwn"

    exports.static = {
        prefix: "/public/",
        dir: path.join(app.baseDir, "public")
    }

    exports.notfound = {
        pageUrl: "/#/404"
    }

    exports.static = {
        prefix: "/static/",
        maxAge: 31536000,
        dir: [path.join(app.baseDir, "app/public"), path.join(app.baseDir, "public")],
    }

    // 存放一些公用资源的
    exports.htmlTemplate = {
        js: [
            `/static/js/vue.min.js`,
            `/static/js/vue-router.min.js`,
            `/static/js/element-ui.js`,
            `/static/js/vuex.min.js`,
            `/static/js/axios.min.js`,
        ],
        css: [`/static/style/ele-ui/index.css`, `/static/style/ele-ui/display.css`]
    }

    return exports
}
